<?php
class Tournament extends AppModel {

	var $name = 'Tournament';
	var $validate = array(
		'name' => array('notempty'),
		'type' => array('notempty'),
		'participants' => array('notempty','numeric'),
		'event_id' => array('notempty'),
		'quote' => array('notempty','numeric')
	);

	//The Associations below have been created with all possible keys, those that are not needed can be removed
	var $belongsTo = array(
		'Event' => array(
			'className' => 'Event',
			'foreignKey' => 'event_id',
			'conditions' => '',
			'fields' => '',
			'order' => ''
		)
	);

	var $hasAndBelongsToMany = array(
		'Deposit' => array(
			'className' => 'Deposit',
			'joinTable' => 'user_tournaments',
			'foreignKey' => 'tournament_id',
			'associationForeignKey' => 'deposit_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'User' => array(
			'className' => 'User',
			'joinTable' => 'user_tournaments',
			'foreignKey' => 'tournament_id',
			'associationForeignKey' => 'user_id',
			'unique' => true,
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		)
	);

}
?>